1. Field of the Invention
The present invention relates to an encoding apparatus and, more particularly, to an encoding apparatus for performing block encoding.
2. Related Background Art
High efficient encoding techniques are becoming more and more important in association with digitization of an image signal. Orthogonal conversion encoding is known as effective means for high efficient encoding.
The orthogonal conversion encoding which intends to convert a time sequence signal which is inputted to an orthogonal component (for example, frequency component) and a DCT (Discrete Cosine Transformation) is well known.
An image encoding method using the DCT will now be described. FIG. 1 is a block diagram of a conventional image encoding apparatus using DCT.
In FIG. 1, reference numeral 101 denotes an input terminal for a digital image signal; 102 a block forming circuit; 103 a DCT circuit; 104 a quantization circuit; 105 a variable length encoding circuit; 106 a buffer memory; and 107 an output terminal.
An image encoding process of the encoding apparatus constructed as mentioned above will now be described.
The digital image signal inputted to the input terminal 101 is divided into blocks on a DCT unit basis by the block forming circuit 102. A 2-dimensional DCT of total 64 pixels (8 pixels in the horizontal direction.times.8 pixels in the vertical direction) is often used in the image encoding. The block formed image signal is 2-dimensional DCT transformed by the DCT circuit 103 and is converted into a DCT component. The converted DCT component is quantized by the quantization circuit 104 and is variable length encoded by the variable length encoding circuit 105 and is converted at a predetermined rate by the buffer memory 106 and is outputted.
The variable length encoding is an encoding system for assigning a small code length to a code word of a large occurrence probability and for assigning a large code length to a code word of a small occurrence probability. Therefore, a data rate after completion of the encoding changes in dependence on picture quality. Accordingly, in order to prevent the occurrence of an overflow or underflow of the buffer memory 106, when a data amount in the buffer memory 106 increases, a quantization width at the time of the quantization is increased in the quantization circuit 104, and when the data amount decreases, the quantization width is decreased, thereby controlling the data amount.
However, in the case of block encoding as mentioned above, when an effective image area is divided by an encoding block, there is a situation such that the entire effective image area cannot be divided by the size of encoding block.
Specifically, a situation as shown in FIG. 2 occurs.
In FIG. 2, assuming that the effective image area is an area of 1920 pixels in width and 1035 pixels in length, in a case of dividing the effective image area into (8.times.8) blocks of the size of (8 pixels in width).times.(8 pixels in length) and encoding, the number of pixels in width of the effective image area can be divided because it is a multiple of 8. However, the number of pixels in length cannot be divided since it is not a multiple of 8. Namely, the effective image area of such a size cannot be divided into (8.times.8) equal blocks.
Therefore, in order to enable the effective image area to be divided into (8.times.8) blocks of the same size, image data of a predetermined level (gray level, black level, white level, or the like) is added as sufficient image data in FIG. 2, thereby making it possible to equally divide the area to (8.times.8) blocks of the same size.
In case of block encoding by adding, for instance, the data of the black level, however, when the true image data which really exists in the encoding block is the signal of the flat white level, the data becomes block data which changes from white to black at a boundary between the true image data and the added dummy image data in the encoding block. When such data is DCT transformed, although only the DC component exists in the original image data, a coefficient occurs in the vertical AC component. When such a DCT component is variable length encoded, the AC component which doesn't exist in the original image signal is generated, so that the data amount increases. Since the accumulation amount in the buffer memory increases, a process to increase a step width of the quantization is executed in order to reduce the data amount.
There is, consequently, a problem such that the quality of the decoded picture deteriorates in dependence on the image. Particularly, such a deterioration causes a problem in the case where an image of a high quality such as a high vision signal is compressed at a high compression ratio.